package ${basePackage}.service.impl;

import ${basePackage}.dao.${modelNameUpperCamel}Mapper;
import ${basePackage}.model.${modelNameUpperCamel};
import ${basePackage}.service.${modelNameUpperCamel}Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import org.apache.ibatis.annotations.Param;
/**
* Created by ${author} on ${date}.
*/
@Service
public class ${modelNameUpperCamel}ServiceImpl implements ${modelNameUpperCamel}Service {
    @Autowired
    private   ${modelNameUpperCamel}Mapper ${modelNameLowerCamel}Mapper;

    @Override
    public int deleteEntityById(String id) {
      return ${modelNameLowerCamel}Mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int addEntity(${modelNameUpperCamel} ${modelNameLowerCamel}) {
        return ${modelNameLowerCamel}Mapper.insert(${modelNameLowerCamel});
    }

    @Override
    public ${modelNameUpperCamel} getEntityById(String id) {
        return ${modelNameLowerCamel}Mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<${modelNameUpperCamel}> getAll() {
        return ${modelNameLowerCamel}Mapper.selectAll();
    }

    @Override
    public int updateEntity(${modelNameUpperCamel} ${modelNameLowerCamel}) {
        return  ${modelNameLowerCamel}Mapper.updateByPrimaryKey(${modelNameLowerCamel});
    }


@Override
public List<${modelNameUpperCamel}> getAllWhere(String wheresql) {
    return ${modelNameLowerCamel}Mapper.selectAllWhere(wheresql);
    }

    @Override
    public int batchInsert(List<${modelNameUpperCamel}> list) {
        return ${modelNameLowerCamel}Mapper.batchInsert(list);
        }

}
